package com.haixiaoke.saas.enterprise.messageCenter.controller;

import com.haixiaoke.saas.common.annotation.TenantScope;
import com.haixiaoke.saas.common.core.page.TableDataInfo;
import com.haixiaoke.saas.common.tenant.TenantContext;
import com.haixiaoke.saas.messageCenter.domain.PublicMessage;
import com.haixiaoke.saas.messageCenter.service.IPublicMessageService;
import com.haixiaoke.saas.system.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 公共消息模版信息Controller
 *
 * @author xiaolong
 * @date 2024-11-12
 */
@RestController
@RequestMapping("/enterprise/messageCenter/publicMessage")
public class EnterprisePublicMessageController extends BaseController {
    @Autowired
    private IPublicMessageService publicMessageService;

    /**
     * 查询公共消息模版信息列表
     */
    @GetMapping("/list")
    @TenantScope
    public TableDataInfo list(PublicMessage publicMessage) {
        startPage();
        List<PublicMessage> list = publicMessageService.selectPublicMessageList(publicMessage);
        return getDataTable(list);
    }

}
